import { useLoading } from "@/plugins/loading";

export type loadType = {
  message: string;
  duration?: number;
  visible?: boolean;
  callback?: () => void;
  backHome?: boolean;
};
export const loading = (options: loadType) => {
  useLoading({
    visible: options.visible || true,
    content: options.message,
    duration: options.duration ?? -1,
    backHome: options.backHome ?? false,
  });
};
